/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.entity;

import java.lang.reflect.Field;
import java.util.Arrays;

/**
 * <p>Project: javaseapp - Demo
 * <p>Powered by webrx On 2021-08-30 09:11:22
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Demo {
    public static void main(String[] args) {
        var a = new Animal();
        //System.out.println(a.getName());
        //System.out.println(a);

        //读取此时a对象的name 通过反射
        var c = a.getClass();
        Field[] fs = c.getDeclaredFields();
        Arrays.stream(fs).forEach(e -> {
            System.out.println(e.getAnnotatedType());
            System.out.println(e.getAnnotation(AnimalName.class).value());
        });
    }
}
